package com.yuju.hotel.enums;
/**
 * 
 * 类名：BuildingReturnCodeEnum  <br />
 *
 * 功能：楼栋业务代码枚举
 *
 * @author : zhousc <br />
 * @Date : 2017年11月27日 上午9:57:27  <br />
 * @version : 1.1 <br />
 */
public enum BuildingReturnCodeEnum {
	BUILDING_QUERY_SUCCESS("yuju-building-1000", "楼栋查询成功"),
	BUILDING_QUERY_FAILURE("yuju-building-1001", "楼栋查询失败"),
	BUILDING_SAVE_SUCCESS("yuju-building-1002", "楼栋保存成功"),
	BUILDING_SAVE_FAILURE("yuju-building-1003", "楼栋保存失败"),
	BUILDING_UPDATE_SUCCESS("yuju-building-1004", "楼栋更新成功"),
	BUILDING_UPDATE_FAILURE("yuju-building-1005", "楼栋更新失败"),
	BUILDING_DEL_SUCCESS("yuju-building-1006", "楼栋删除成功"),
	BUILDING_DEL_FAILURE("yuju-building-1007", "楼栋下有楼层，不可删除"),
	BUILDING_VALID_SUCCESS("yuju-building-1008", "校检成功"),
	BUILDING_VALID_FAILURE("yuju-building-1009", "校检失败");
	
	private String code;
	private String desc;
	
	BuildingReturnCodeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	public static String getDescByCode(String code) {
		for (BuildingReturnCodeEnum enume : BuildingReturnCodeEnum.values()) {
			if (enume.getCode().equals(code)) {
				return enume.getDesc();
			}
		}
		
		return "未知枚举类型";
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}